import { postService, postServiceList } from '.'
import { PORT1 } from '../config/net.config'
import { Promotion, Retail } from './interface/retail'

// 零售调价单
export const getAdjustPriceAPI = (params: {}) => {
  return postServiceList<Retail.AdjustPrice>(`${PORT1}/corecmsadjustprice/getpagelist`, params, false)
}
export const createAdjustPriceAPI = (params: {}) => {
  return postService<null>(`${PORT1}/corecmsadjustprice/docreate`, params, 'json')
}
export const editAdjustPriceAPI = (params: {}) => {
  return postService<null>(`${PORT1}/corecmsadjustprice/doedit`, params, 'json')
}
export const getAdjustPriceDetailAPI = (params: {}) => {
  return postService<Retail.AdjustPriceDetail>(`${PORT1}/corecmsadjustprice/getedit`, params, 'json')
}
export const deleteAdjustPriceAPI = (params: {}) => {
  return postService<null>(`${PORT1}/corecmsadjustprice/dodelete`, params, 'json')
}
export const checkAdjustPriceAPI = (params: {}) => {
  return postService(`${PORT1}/corecmsadjustprice/DoCheck`, params, 'json')
}
export const uncheckAdjustPriceAPI = (params: {}) => {
  return postService(`${PORT1}/corecmsadjustprice/CancelCheck`, params, 'json')
}

// 促销 start
// 限时活动
export const getDiscountLimitAPI = (params: {}) => {
  return postServiceList<Promotion.DiscountLimit>(`${PORT1}/corecmsactivityinfo/getpagelist`, params, false)
}
export const createDiscountLimitAPI = (params: {}) => {
  return postService<null>(`${PORT1}/corecmsactivityinfo/docreate`, params, 'json')
}
export const editDiscountLimitAPI = (params: {}) => {
  return postService<null>(`${PORT1}/corecmsactivityinfo/doedit`, params, 'json')
}
export const getDiscountLimitDetailAPI = (params: {}) => {
  return postService<Promotion.DiscountLimitDetail>(`${PORT1}/corecmsactivityinfo/getedit`, params, 'json')
}
export const deleteDiscountLimitAPI = (params: {}) => {
  return postService<null>(`${PORT1}/corecmsactivityinfo/dodelete`, params, 'json')
}
export const checkDiscountLimitAPI = (params: {}) => {
  return postService<null>(`${PORT1}/corecmsactivityinfo/DoCheck`, params, 'json')
}
export const stopDiscountLimitAPI = (params: {}) => {
  return postService<null>(`${PORT1}/corecmsactivityinfo/DoStop`, params, 'json')
}
